package com.linchaoen.elema.mapper;

import com.linchaoen.elema.model.entity.Address;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AddressMapper {

    Address getDefaultAddr(@Param("user_id") Integer userId);

    List<Address> getAllAddr(@Param("user_id") Integer uid);

    int addAddr(Address address);

    int setDefaultAddr(@Param("user_id") Integer uid, @Param("id") Integer id);

    int setNoDefault(@Param("user_id") Integer uid, @Param("id") Integer id);

    int deleteAddr(@Param("user_id") Integer uid, @Param("id") Integer id);

    int updateAddr(Address addr);
}
